<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
 <h1>The Goods Page</h1>
 <button onclick="doLoadAddUI()">添加商品</button>
 <a th:href="@{/goods/doGoodsAddUI}">添加商品</a>
 <table>
    <thead><!-- thead通常用于定义表格的title部分 -->
       <tr>
         <th>id</th> <!-- th用于定义当前列的标题 -->
         <th>name</th>
         <th>remark</th>
         <th>createdTime</th>
         <th colspan="2">operation</th>
       </tr>
    </thead>
    <tbody><!-- tbody中通常用于定义表格的表体部分:呈现具体业务数据的区域 -->
        <tr th:each="g:${list}">
          <td th:text="${g.id}">1</td>  
          <td th:text="${g.name}">MySQL</td>  
          <td th:text="${g.remark}">RDBMS</td>  
          <td th:text="${#dates.format(g.createdTime, 'yyyy/MM/dd HH:mm')}">2020/08/03 16:10</td> 
          <td><a th:href="@{/goods/doDeleteById/{id}(id=${g.id})}">delete</a></td> 
          <td><a th:href="@{/goods/doFindById/{id}(id=${g.id})}">update</a></td> 
        </tr>
    </tbody>
 </table>
 <!-- 建议:所有的js代码写到body的最底端 -->
 <script type="text/javascript">
      function doLoadAddUI(){
    	  //跳转到url对象的地址
    	  location.href='/goods/doGoodsAddUI';
    	  //location.href='doGoodsAddUI';
      }
 </script>
</body>
</html>




